import * as CONSTANT from "@/store/constant.js";

const defaultState = {
    count: 0,
    articles: null,
    currentPage: 1
}

const commentReducer = (state = defaultState, action) => {
    switch (action.type) {
        case CONSTANT.ARTICLES_SYNC:
            // eslint-disable-next-line no-case-declarations
            const {count, articles, currentPage} = action.payload;
            return {...state, count, articles, currentPage};
        default:
            return state;
    }
}
export default commentReducer;